// Web 客户端

var http = require('http');

var options = {
	host: 'localhost',
	port: '8888',
	path: '/httpIndex.html'
};

// 处理响应的回调函数
var callback = function(resp) {
	var body = '';
	resp.on('data', function(data) {
		body += data;
	});
	
	resp.on('end', function() {
		// 数据接收完成
		console.log(body);
	});
};

// 向服务端发送请求
var req = http.request(options, callback);
req.end();
